<template>
  <!-- <div id="xxx" ref="cesiumContainer"></div> -->
  <div class="imgaaa">
    <div>2</div>
    <div></div>
    <!-- <img src="./images/天际线.png" alt=""> -->
  </div>
</template>

<script>
export default {
  name: '',
  components: {},
  props: {},
  data() {
    return {};
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    this.init();
  },
  methods: {
    // init() {
    //   const viewer = new Cesium.Viewer('xxx');
    // },
    init() {
      const viewer = new Cesium.Viewer('xxx', {
        infoBox: false, //注释掉界面可获取模型对应id
        //preserveDrawingBuffer: true,
        navigation: false,
        // shadows: true, //使用日照分析需设置为true
        terrainExaggeration: 1, // 地形服务缩放比例
        orderIndependentTranslucency: false,
      });
      // window.viewer = this.viewer;
      let scene = viewer.scene;
      //   降低性能提高图片质量
      scene.fxaa = true;
      scene.globe.maximumScreenSpaceError = 1;
      scene.hdrEnabled = false;
      //如果除非在地球的另一侧，则应始终在地形顶部绘制此类图元(depthTestAgainstTerrain=false)
      // scene.globe.depthTestAgainstTerrain = false;
      // this.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 500000;
      // viewer.imageryLayers.get(0).show = false; //不显示底图
      // viewer.scene.globe.baseColor = Cesium.Color.WHITE; //设置地球颜色
      // 定位到地图坐标及高度
      //设置相机视角
      viewer.scene.camera.setView({
        destination: Cesium.Cartesian3.fromDegrees(
          119.48898233859406,
          29.94018203147318,
          252460.1101064507,
        ),
      });
      // viewer.scene.camera.setView({
      //   destination: Cesium.Cartesian3.fromDegrees(
      //     119.48898233859406,
      //     29.94018203147318,
      //     252460.1101064507
      //   ),
      //   // orientation: {
      //   //   heading: 0,
      //   //   pitch: 0,
      //   //   roll: 0,
      //   // },
      // });
      // 电子地图
      // viewer.imageryLayers.addImageryProvider(
      //   new Cesium.CGCS2000MapServerImageryProvider({
      //     // name: item.name,
      //     url:
      //       "http://www.supermapol.com/realspace/services/3D-ZF_normal/rest/realspace/datas/image.openrealspace",
      //     suggest: true,
      //   })
      // );
      viewer.scene.addVectorTilesMap({
        url: 'http://www.supermapol.com/realspace/services/3D-ZF_normal/rest/realspace/datas',
      });
    },
  },
};
</script>

<style  >
.cesium-viewer-bottom,
.cesium-zoom-wrapper {
  display: none;
}
#xxx {
  width: 100%;
  height: 100vh;
}
.imgaaa {
  display: flex;
  /* width: 30px;
  height: 30px;
  border:  1px solid #000;
  /* background-image: url("./images/1111.webp") no-repeat; */
}
.imgaaa div {
  width: 100px;
  height: 50px;
  border: 1px red solid;
  transform: skewX(25deg);
}
.imgaaa:hover {
  filter: drop-shadow(0 0 0 red);
  background-image: url('./images/天际线.png');
  /* background-image: url("./images/天际线.png"), linear-gradient(#f00, #f00) ; */
}
</style>

